<template>
  <page-wrap back hide-tab :title="pageTitle" stay-still>
    <view class="login-wrap">
      <view class="login" v-if="pageTitle === '登录'">
        <view class="login-title">{{ loginType[activeLogin].title }}</view>
        <view class="login-form">
          <u-field :clearable="false" v-model="login.phone" placeholder="请输入手机号" placeholder-style="color: #bbbbbb;"
            type="number" label-width="0"></u-field>
          <view v-if="activeLogin === 0">
            <u-field v-model="captchaCode" placeholder="请输入图形验证码" placeholder-style="color: #bbbbbb;" label-width="0"
              :clearable="false">
              <image slot="right" style="width: 80px; height: 26px" :src="captchPicture + captchaId"
                @click="getCaptchImg"></image>
            </u-field>

            <u-field v-model="login.code" placeholder="请输入验证码" placeholder-style="color: #bbbbbb;" type="number"
              label-width="0" :clearable="false" @confirm="handleLogin">
              <text class="send-code" slot="right" @click="handleSendCode">{{
                login.codeText
              }}</text>
            </u-field>
          </view>
          <view class="password-input u-border-bottom" v-else>
            <input v-if="login.pswType == 'password'" class="input" v-model="login.psw" placeholder="请输入密码"
              placeholder-style="color: #bbbbbb;" type="password" :clearable="false" :adjust-position="false"
              label-width="0" @confirm="handleLogin" />
            <input v-else class="input" v-model="login.psw" placeholder="请输入密码" placeholder-style="color: #bbbbbb;"
              type="text" :clearable="false" :adjust-position="false" label-width="0" @confirm="handleLogin" />
            <view class="eye-wrap" @click="handleShowPsw">
              <text :class="['show-psw', login.pswType]"></text>
            </view>
          </view>
          <u-button type="primary" :class="['btn-login', { disable: !isLogin }]" hover-class="none"
            @click="handleLogin">登录</u-button>
          <view class="login-type" @click="activeLogin = activeLogin ? 0 : 1">{{
            loginType[activeLogin].toTitle
          }}</view>
          <!-- <view class="login-type">
            <text
              class="forget-psw"
              @click="handleForget"
              >忘记密码</text
            >
            <text
              class="change-type"
              @click="activeLogin = activeLogin ? 0 : 1"
              >{{ loginType[activeLogin].toTitle }}</text
            >
          </view> -->
        </view>
        <view class="login-register" style="margin-bottom: 5rpx">
          未有账号，前往<text class="link" @click="handleShift">注册</text>
        </view>
      </view>
      <view class="register" v-else>
        <view class="register-title">注册</view>
        <view class="register-form">
          <u-field :clearable="false" v-model="register.phone" placeholder="请输入手机号" placeholder-style="color: #bbbbbb;"
            type="number" label-width="0"></u-field>
          <view class="password-input u-border-bottom">
            <input v-if="register.pswType == 'password'" class="input" v-model="register.psw"
              :placeholder="pswPlaceholder" placeholder-style="color: #bbbbbb;" type="password" :clearable="false"
              :adjust-position="false" label-width="0" />
            <input v-else class="input" v-model="register.psw" :placeholder="pswPlaceholder"
              placeholder-style="color: #bbbbbb;" type="text" :clearable="false" :adjust-position="false"
              label-width="0" />
            <view class="eye-wrap" @click="handleShowPsw">
              <text :class="['show-psw', register.pswType]"></text>
            </view>
          </view>

          <u-field v-model="captchaCode" placeholder="请输入图形验证码" placeholder-style="color: #bbbbbb;" label-width="0"
            :clearable="false">
            <image slot="right" style="width: 80px; height: 26px" :src="captchPicture + captchaId"
              @click="getCaptchImg"></image>
          </u-field>

          <u-field v-model="register.code" placeholder="请输入验证码" placeholder-style="color: #bbbbbb;" type="number"
            label-width="0" :clearable="false" @confirm="handleRegister">
            <text class="send-code" slot="right" @click="handleSendCode">{{
              register.codeText
            }}</text>
          </u-field>
          <u-button type="primary" :class="['btn-register', { disable: !isRegister }]" block
            @click="handleRegister">免费注册</u-button>
        </view>
        <view class="register-login">
          已有账号，前往<text class="link" @click="handleShift">登录</text>
        </view>
      </view>
      <view class="politica">
        <u-checkbox label-size="24" v-model="privacyAuthStatus">我已阅读并同意</u-checkbox>
        <text class="text-base" @click="clickSevice">《服务协议》</text>和<text class="text-base"
          @click="clickPrivacy">《隐私政策》</text>
      </view>
    </view>
  </page-wrap>
</template>

<script>
import { apiClusterJava } from "@/api/root";
import IMEventHandler from "@/utils/im";
import { checkPhoneValid, checkPassword } from "@/utils/handle";
import {
  checkUnameCanReg,
  sendLoginCode,
  sendRegcode,
  loginByCode,
  loginByAccount,
  registerBySmsForXCX,
  detailPermission,
  bindPerson,
  clickShareLink,
  captchaInit,
} from "@/api/index";
import { getCareerAssessmentVersion } from "@/api/modules/activity";
import {
  getApplyStatusByPersonId,
  cardRegist,
  getUserInfo,
  autoGenerateName,
  reportRegisterLog,
} from "@/api/modules/career";
import { showDelayToastTip } from "@/utils/handle";

import ShareMixin from "@/mixins/share";
export default {
  mixins: [ShareMixin],

  data() {
    return {
      pswPlaceholder: "需8-20位大小写字母、数字、特殊符号组成密码",
      showModal: false,
      title: "用户协议及隐私政策",
      content: "cdsdsaddksajmdksajmdaskdmaskdasmdaskd",
      pageTitle: "登录",
      activeLogin: 0,
      loginType: [
        {
          name: "letter",
          title: "短信登录",
          toTitle: "密码登录",
        },
        {
          name: "account",
          title: "密码登录",
          toTitle: "短信登录",
        },
      ],
      login: {
        pswType: "password",
        codeText: "获取验证码",
        codeTimer: null,
      },
      register: {
        pswType: "password",
        codeText: "获取验证码",
        codeTimer: null,
      },
      fromType: "",
      resumeId: "",
      previewId: {},
      returnUrl: "",
      targetPath: "",
      privacyAuthStatus: false,
      captchaCode: "",
      captchaId: "",
      captchPicture: "",
    };
  },
  created() {
    const pages = getCurrentPages();
    const prevPage = pages[pages.length - 2]; // 获取上一个页面的信息
    const prevPageRoute = prevPage ? prevPage.route : ""; // 获取上一个页面的路由
    console.log("上一个页面的路由：", prevPageRoute);
    if (prevPageRoute.indexOf("careerPath") != -1) {
      uni.setStorageSync("isZhituUser", true); //职途用户标识（注册的时候传regSource用
    }
    this.captchPicture = apiClusterJava + "/api-auth/common/captcha/draw/";
  },
  onLoad(options) {
    this.fromType = options && options.type ? options.type : "";
    this.resumeId = options && options.resumeId ? options.resumeId : "";
    this.previewId.mpaActivityId =
      options && options.mpaActivityId ? options.mpaActivityId : "";
    this.previewId.sharePersonId =
      options && options.sharePersonId ? options.sharePersonId : "";
    this.returnUrl = (options && options.returnUrl) || "";
    this.targetPath = (options && options.targetPath) || "";
    console.log("this.targetPath", this.targetPath);
    this.getCaptchImg();
  },
  computed: {
    isLogin() {
      if (this.activeLogin === 0) {
        return this.login.phone && this.login.code;
      } else {
        return this.login.phone && this.login.psw;
      }
    },
    isRegister() {
      return this.register.phone && this.register.psw && this.register.code;
    },
  },
  // onShareAppMessage() {
  //   return {
  //     title: this.$selfName,
  //     path: "/pages/index/index",
  //   };
  // },
  // onShareTimeline() {
  //   return {
  //     title: this.$selfName,
  //     path: "/pages/index/index",
  //   };
  // },
  methods: {
    showMessage() {
      this.showModal = true;
    },
    handleCheckPhone(uname, callback) {
      if (!uname) {
        return uni.showToast({ icon: "none", title: "请输入手机号" });
      }
      if (!checkPhoneValid(uname)) {
        return uni.showToast({ icon: "none", title: "请输入正确手机号" });
      }
      uni.showLoading();
      checkUnameCanReg({ uname })
        .then((res) => {
          uni.hideLoading();
          if (callback) callback(res);
        })
        .catch(() => {
          uni.hideLoading();
        });
    },
    handleSendCode() {
      let flag = this.pageTitle === "登录";
      let target = flag ? this.login : this.register;
      let fcn = flag ? sendLoginCode : sendRegcode;
      if (target.codeTimer) return;
      this.handleCheckPhone(target.phone, (checkRes) => {
        if (flag) {
          if (checkRes.data) {
            //return uni.showToast({ icon: "none", title: "该手机未注册" });
            return showDelayToastTip("该手机未注册", 0);
          }
        } else {
          if (!checkRes.data) {
            return showDelayToastTip("该手机已注册", 0);
            // return uni.showToast({ icon: "none", title: "该手机已注册" });
          }
        }
        if (!this.captchaCode) {
          return uni.showToast({ icon: "none", title: "请输入图形验证码" });
        }
        fcn({
          mobile: target.phone,
          code: this.captchaCode,
          captchaId: this.captchaId,
        })
          .then((res) => {
            uni.showToast({ icon: "none", title: res.status_desc });
            if (res.status === "OK") {
              let sec = 60;
              this.$set(target, "codeText", `${--sec} s`);
              target.codeTimer = setInterval(() => {
                this.$set(target, "codeText", `${--sec} s`);
                if (sec < 1) {
                  clearInterval(target.codeTimer);
                  this.$set(target, "codeTimer", null);
                  this.$set(target, "codeText", "获取验证码");
                }
              }, 1000);
            }
          })
          .catch(() => {
            this.getCaptchImg();
          });
      });
    },
    handleShowPsw() {
      let target = this.pageTitle === "登录" ? this.login : this.register;
      let data = target.pswType === "password" ? "text" : "password";
      this.$set(target, "pswType", data);
    },
    handleShift() {
      this.pageTitle = this.pageTitle === "登录" ? "注册" : "登录";
    },
    handleLogin() {
      if (!this.privacyAuthStatus) {
        uni.showToast({
          title: "请先阅读并同意政策协议",
          icon: "none",
        });
        return;
      }
      this.handleCheckPhone(this.login.phone, (checkRes) => {
        if (checkRes.data)
          return uni.showToast({ icon: "none", title: "该手机未注册" });
        if (!this.activeLogin && !this.login.code) {
          return uni.showToast({ icon: "none", title: "请输入验证码" });
        }
        if (this.activeLogin && !this.login.psw) {
          return uni.showToast({ icon: "none", title: "请输入密码" });
        }
        let fcn = this.activeLogin ? loginByAccount : loginByCode;
        let errorTxt = this.activeLogin
          ? "用户名或密码错误"
          : "手机号或验证码错误";
        let param = this.activeLogin
          ? {
              mobile: this.login.phone,
              password: this.login.psw,
            }
          : {
              mobile: this.login.phone,
              code: this.login.code,
              // authCode: this.login.code,
              // condition: '{ "fromtype": "xcx" }',
            };
        uni.showLoading({
          title: "正在登录",
          mask: true,
        });
        fcn(param).then((res) => {
          if (this.activeLogin) {
            // 账号密码登录，跳到弱密码强化页面
            if (res && res.code == 202) {
              uni.hideLoading();
              let url =
                "/pagesSub/passwordStrengthen/index?phone=" + this.login.phone;
              uni.navigateTo({ url });
              return;
            }
          }
          if (res.status === "OK") {
            let personId = res.data.personId || res.data;
            this.reportShareData(personId, "login");
            this.handleAfterLogin(personId);
          } else {
            uni.hideLoading();
            showDelayToastTip(errorTxt + "", 50);
          }
        });
      });
    },
    handleRegister() {
      if (!this.privacyAuthStatus) {
        uni.showToast({
          title: "请先阅读并同意政策协议",
          icon: "none",
        });
        return;
      }
      if (!this.register.psw) {
        return uni.showToast({ icon: "none", title: "请输入密码" });
      }
      if (!checkPassword(this.register.psw)) {
        return uni.showToast({
          icon: "none",
          title: this.pswPlaceholder,
        });
      }
      if (!this.register.code) {
        return uni.showToast({ icon: "none", title: "请输入验证码" });
      }
      this.handleCheckPhone(this.register.phone, (checkRes) => {
        if (!checkRes.data)
          return uni.showToast({ icon: "none", title: "该手机已注册" });
        let param = {
          mobile: this.register.phone,
          code: this.register.code,
          password: this.register.psw,
        };
        const isZhituUser = uni.getStorageSync("isZhituUser");

        console.log("registerBySmsForXCX", isZhituUser);
        if (isZhituUser) {
          param.regSource = "miniProgramZhitu"; //如果是职途相关页面登录要传注册来源
          uni.removeStorageSync("isZhituUser");
        }
        uni.showLoading({
          title: "正在注册",
          mask: true,
        });
        registerBySmsForXCX(param).then((res) => {
          if (res.status === "OK") {
            if (res && +res.code === 200) {
              this.reportShareData(res.data, "reg");
              this.handleAfterLogin(res.data, true);
              console.log("registerBySmsForXCX", res.data);

              //2025年5月14日注册成功后如果有sellerId，请求埋点接口

              const sellerId = uni.getStorageSync("sellerId");
              console.log("wxlogin sellerId", sellerId);
              if (sellerId) {
                this.reqReportRegisterLog(uni.getStorageSync("person-id").slice(2) || undefined);
              }
              //新用户而且是职途用户就请求接口改一个特殊的名字
              if (isZhituUser) {
                this.reqAutoGenerateName(res.data);
              }
            }
          } else {
            uni.hideLoading();
            showDelayToastTip(res.status_desc + "", 50);
          }
        });
      });
    },
    reqReportRegisterLog(personId) {
      const params = {
        personId, //新用户的personId
        sellerId: uni.getStorageSync("sellerId"),
        project: "10", //10高考选科 20职业大全 30高考报志愿 40职途机
      };
      reportRegisterLog(params)
        .then((res) => {})
        .catch(() => {});
    },
    reqAutoGenerateName(personId) {
      const params = {
        personId,
      };
      autoGenerateName(params)
        .then((res) => {
          if (res.code == 200) {
          }
        })
        .catch((e) => {
          console.log(e);
        });
    },
    getApplyStatusByPersonIdFn() {
      const params = {
        personId: uni.getStorageSync("person-id").slice(2) || undefined,
      };
      getApplyStatusByPersonId(params).then((res) => {
        if (res.code == 200 && res.data && res.data == 1) {
          getApp().globalData.userIsConsultant = true;
        } else {
          getApp().globalData.userIsConsultant = false;
        }
      });
    },
    getCareerAssessmentVersionFn() {
      const params = {
        personId: uni.getStorageSync("person-id").slice(2) || undefined,
        assessmentType: 0,
      };
      getCareerAssessmentVersion(params).then((res) => {
        if (res.code == 200) {
          uni.setStorageSync("assessmentVersion", res.data);
        }
      });
    },
    handleAfterLogin(personId, isReg) {
      let msg = isReg ? "注册成功" : "登录成功";
      uni.setStorageSync("person-id", "id" + personId);
      this.bindOpenId(personId);
      this.getApplyStatusByPersonIdFn();
      this.getCareerAssessmentVersionFn();
      let isImLogin =
        getApp().globalData.tim && getApp().globalData.tim.getLoginUser();
      let isLogin = false;
      if (!isImLogin) {
        new IMEventHandler(() => {
          let currentPage = getCurrentPages()[0].route;
          if (currentPage.indexOf("login") >= 0) {
            isLogin = true;
            uni.hideLoading();
            uni.showToast({ icon: "none", title: msg });
            this.handleJump(isReg);
          }
        });
        setTimeout(() => {
          if (!isLogin) {
            getApp().globalData.tim && getApp().globalData.tim.logout();
            getApp().globalData.tim = null;
            uni.hideLoading();
            uni.showToast({ icon: "none", title: msg });
            this.handleJump(isReg);
          }
        }, 5000);
      } else {
        uni.hideLoading();
        uni.showToast({ icon: "none", title: msg });
        this.handleJump(isReg);
      }
    },
    jumpToApply() {
      if (uni.getStorageSync("person-id").slice(2)) {
        // 请求用户数据
        this.$bus.$emit("getUserInfo", (callback) => {
          this.doApply();
        });
      } else {
        this.doApply();
      }
    },
    doApply() {
      const tel = getApp().globalData.userInfo.shouji
        ? getApp().globalData.userInfo.shouji
        : "";
      const enUrl = encodeURIComponent(
        `https://m.job1001.com/v2/apply/#/apply/basic?tel=${tel}`
      );
      uni.navigateTo({
        url: `/pagesSub/userCenter/hrApply/index?url=${enUrl}`,
      });
    },
    jumpToDetail(personId) {
      // 是否内部员工（权限控制资料详情页的查看）
      const userInfo = getApp().globalData.userInfo || { shouji: "" };
      const params = {
        tel: userInfo.shouji,
        personId: personId,
      };
      detailPermission(params).then((res) => {
        if (res.data.isShowDetail == 1) {
          uni.reLaunch({
            url: `/pagesSub/userCenter/hrDetail/index?resumeId=${this.resumeId}`,
          });
        } else {
          if (getApp().globalData.loginStatus === "company") {
            uni.reLaunch({ url: "/pages/companyCenter/index" });
          } else {
            uni.reLaunch({ url: "/pages/userCenter/index" });
          }
        }
      });
    },
    cardRegistFn(params) {
      cardRegist(params).then((res) => {
        if (res.code != 200) {
          uni.showToast({
            icon: "none",
            title: res.status_desc,
            duration: 1500,
          });
        }
      });
    },
    handleJump(isReg) {
      setTimeout(() => {
        let url = this.doubleDecodeURIComponent(this.targetPath);
        if (
          url &&
          url ===
            "/pagesSub/userCenter/careerPath/activateCareerPathCard/stepTwo"
        ) {
          console.log("进入wuhan分支");
          getUserInfo({ uid: "" }).then((res) => {
            if (res.code == 200) {
              if (!res.data.cardNo) {
                // 如果是从营销页面传过来了cardType，就在这里进行绑卡操作
                const cardType = uni.getStorageSync("cardType");
                const sellId = uni.getStorageSync("sellId");
                cardType &&
                  this.cardRegistFn({
                    cardType,
                    sellId: +sellId,
                    cardKey: "1",
                  });
                uni.redirectTo({
                  url: `${url}?targetPath=/pagesSub/userCenter/careerPathV2/components/WuHanBuyPage?isNewRegister=true`,
                });
              } else {
                uni.redirectTo({
                  url: "/pagesSub/userCenter/careerPathV2/components/WuHanBuyPage",
                });
              }
            }
          });
          return;
        }
        if (
          url &&
          url === "/pagesSub/userCenter/careerPathV2/components/CBuyPage"
        ) {
          console.log("进入CBuyPage分支");
          getUserInfo({ uid: "" }).then((res) => {
            if (res.code == 200) {
              if (!res.data.cardNo) {
                // 如果是从营销页面传过来了cardType，就在这里进行绑卡操作
                const cardType = uni.getStorageSync("cardType");
                const sellId = uni.getStorageSync("sellId");
                cardType &&
                  this.cardRegistFn({
                    cardType,
                    sellId: +sellId,
                    cardKey: "1",
                  });
                uni.redirectTo({
                  url: `${url}?targetPath=/pagesSub/userCenter/careerPathV2/components/CBuyPage?isNewRegister=true`,
                });
              } else {
                uni.redirectTo({
                  url: "/pagesSub/userCenter/careerPathV2/components/CBuyPage",
                });
              }
            }
          });
          return;
        }
        if (
          url &&
          url === "/pagesSub/career/activity/JuniorCareerConsultantBuy"
        ) {
          console.log("进入JuniorCareerConsultantBuy分支，针对中学生");
          getUserInfo({ uid: "" }).then((res) => {
            if (res.code == 200) {
              if (!res.data.cardNo) {
                // 如果是从JuniorCareerConsultantBuy页面传过来了cardType，就在这里进行绑卡操作
                const cardType = uni.getStorageSync("cardType");
                const sellId = uni.getStorageSync("sellId");
                cardType &&
                  this.cardRegistFn({
                    cardType,
                    sellId: +sellId,
                    cardKey: "1",
                  });
                uni.redirectTo({
                  url: `${url}?targetPath=/pagesSub/userCenter/careerPathV2/components/CBuyPage?isNewRegister=true`,
                });
              } else {
                uni.redirectTo({
                  url: "/pagesSub/career/activity/JuniorCareerConsultantBuy",
                });
              }
            }
          });
          return;
        }
        // 应聘者面试填写
        if (this.fromType == "apply") {
          this.jumpToApply();
          return false;
        }
        // 点击转发详情页，授权后跳转回去
        if (this.resumeId) {
          this.jumpToDetail(personId);
          return false;
        }
        if (
          uni.getStorageSync("routPage") == "pages/reportPreview/reportPreview"
        ) {
          uni.reLaunch({
            url: `/pagesSub/careerGrow/reportPreview/reportPreview?mpaActivityId=${this.previewId.mpaActivityId}&sharePersonId=${this.previewId.sharePersonId}`,
          });
          return;
        }

        let fromLoginStatus = uni.getStorageSync("fromLoginStatus");
        if (fromLoginStatus == "company") {
          getApp().globalData.tabBarList = getApp().globalData["companyTabs"];
          getApp().globalData.loginStatus = "company";
          uni.setStorageSync("login-status", "company");
        }
        let path = this.doubleDecodeURIComponent(this.returnUrl);
        if (
          path == "/pagesSub/careerNew/positionDictionary/JobDescriptionDetail"
        ) {
          // uni.redirectTo({ url: path });
          uni.navigateBack();
          return;
        }
        if (path) {
          // uni.reLaunch({ url: path });
          this.$bus.$emit("onLoginSuccess", "ok");
          uni.navigateBack();
          return;
        }
        if (isReg) {
          uni.reLaunch({ url: "/pagesSub/public/identity/index" });
          return;
        }
        if (getApp().globalData.loginStatus === "company") {
          uni.reLaunch({ url: "/pages/companyCenter/index" });
        } else {
          uni.reLaunch({ url: "/pages/userCenter/index" });
        }
      }, 500);
    },
    // 绑定openid
    bindOpenId(personId) {
      const openId = uni.getStorageSync("openid");
      const params = {
        personId: personId,
        openId: openId,
      };
      bindPerson(params);
    },

    reportShareData(personId, type) {
      let shareCode = getApp().globalData.shareCode;
      if (!shareCode) return;

      clickShareLink({
        personId,
        uniqueCode: shareCode,
        type,
      });
    },
    //服务协议
    clickSevice() {
      uni.navigateTo({
        url: `/pagesSub/public/web/BasewebView?url=${encodeURIComponent(
          "https://m5.yl1001.com/marketing/about/agreement.html"
        )}&title=用户服务协议`,
      });
    },
    //隐私政策
    clickPrivacy() {
      uni.navigateTo({
        url: `/pagesSub/public/web/BasewebView?url=${encodeURIComponent(
          "https://m5.yl1001.com/marketing/about/security.html"
        )}`,
      });
    },
    doubleDecodeURIComponent(encodedString) {
      let decodedString = decodeURIComponent(encodedString);
      let encodedCharacters = /%(?:[0-9A-Fa-f]{2})+/g;

      while (encodedCharacters.test(decodedString)) {
        decodedString = decodeURIComponent(decodedString);
      }

      return decodedString;
    },
    getCaptchImg() {
      captchaInit().then((res) => {
        this.captchaId = res.data;
      });
    },
  },
};
</script>

<style lang="scss">
$img-base-login: $img-base + "login/";

.login-wrap {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 1rpx;
  background: $uni-bg-color;

  .send-code {
    color: $u-type-primary;
  }

  .eye-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80rpx;
    height: 80rpx;
    margin-top: -32rpx;
    margin-bottom: -32rpx;
  }

  .show-psw {
    display: block;
    width: 48rpx;
    height: 48rpx;
    background-image: url($img-base-login + "eye.png");
    background-size: 100% 100%;

    &.password {
      background-image: url($img-base-login + "eyeoff.png");
    }
  }

  .password-input {
    display: flex;
    align-items: center;
    padding: 24rpx 8rpx;
    // #ifdef H5
    padding: 24rpx 8rpx 20rpx;

    // #endif
    input {
      flex-grow: 1;
    }

    // #ifdef H5
    .input {
      flex-grow: 1;
      border: none;
      outline: none;
      font-family: inherit;
      line-height: 48rpx;
      font-size: $uni-font-size-base;

      &::placeholder {
        color: $uni-text-color-placeholder;
      }
    }

    // #endif
  }

  .login {
    flex-grow: 1;
    display: flex;
    flex-direction: column;

    .login-title {
      flex-shrink: 0;
      margin: 140rpx 0 120rpx;
      font-size: 56rpx;
      font-weight: bold;
      text-align: center;
    }

    .login-form {
      flex-grow: 1;
      padding: 0 54rpx;

      .u-field {
        padding: 24rpx 0;
      }

      ::v-deep button {
        margin-top: 80rpx;
      }

      .login-type {
        margin-top: 44rpx;
        font-size: $uni-font-size-lg;
        color: $uni-text-color-555;
        text-align: center;
      }

      .btn-login {
        background: linear-gradient(342deg, #ff5637 0%, #ff7f4e 100%);

        font-size: $uni-font-size-lg;
        &.disable {
          opacity: 0.5;
        }
      }
    }

    .login-register {
      font-size: $uni-font-size-lg;
      color: $uni-text-color-555;
      text-align: center;

      .link {
        margin: 0 4rpx;
        color: $u-type-primary;
      }
    }
  }

  .register {
    flex-grow: 1;
    display: flex;
    flex-direction: column;

    .register-title {
      flex-shrink: 0;
      margin: 140rpx 0 120rpx;
      font-size: 56rpx;
      font-weight: bold;
      text-align: center;
    }

    .register-form {
      flex-grow: 1;
      padding: 0 54rpx;

      .u-field {
        padding: 24rpx 0;
      }

      ::v-deep .u-btn {
        margin-top: 80rpx;
      }

      .btn-register {
        background: linear-gradient(342deg, #ff5637 0%, #ff7f4e 100%);

        &.disable {
          opacity: 0.5;
        }
      }
    }

    .register-login {
      margin-top: 44rpx;
      font-size: $uni-font-size-lg;
      color: $uni-text-color-555;
      text-align: center;

      .link {
        margin: 0 4rpx;
        color: $u-type-primary;
      }
    }
  }

  .politica {
    margin-bottom: 40rpx;
    text-align: center;
    font-size: 24rpx;

    ::v-deep .u-checkbox__label {
      margin-right: 4rpx;
    }
  }
}

.contentAll {
  width: 100%;
  height: 100%;
  padding: 36rpx;
  padding-bottom: 0;
  font-size: 30rpx;

  .title1 {
    font-weight: 600;
    margin-bottom: 10rpx;
  }

  .content {
    margin-bottom: 40rpx;
  }
}
</style>
